﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using MaintenanceTableAdapters;

/// <summary>
/// Summary description for MaintenanceBLL
/// </summary>
public class MaintenanceBLL
{
    ILE_Global ileGlobal = new ILE_Global();

    private MaintenanceTableAdapter _maintenanceAdapter = null;
    protected MaintenanceTableAdapter MaintenanceAdapter
    {
        get
        {
            if (_maintenanceAdapter == null)
                _maintenanceAdapter = new MaintenanceTableAdapter();

            return _maintenanceAdapter;
        }
    }

    /// <summary>
    /// Get Maintenance
    /// </summary>
    /// <param name="Type">'Application' or 'ClassPopup'</param>
    /// <returns>
    ///     A row of Maintenance
    /// </returns>
    [System.ComponentModel.DataObjectMethodAttribute
        (System.ComponentModel.DataObjectMethodType.Select, true)]
    public Maintenance.MaintenanceRow GetMaintenance(string Type)
    {
        return MaintenanceAdapter.GetMaintenance(Type)[0];
    }

    /// <summary>
    /// Update Maintenance
    /// </summary>
    /// <param name="Message"></param>
    /// <param name="IsEnabled"></param>
    /// <param name="Type">'Application' or 'ClassPopup'</param>
    /// <returns>Boolean value</returns>
    [System.ComponentModel.DataObjectMethodAttribute
        (System.ComponentModel.DataObjectMethodType.Update, true)]
    public bool UpdateMaintenance(string Message, bool IsEnabled, string Type)
    {
        return MaintenanceAdapter.UpdateMaintenance(Message, IsEnabled, Type) == 1;
    }

}
